
/** MatrixFramework.h
 * File contains namespace and class which is the port from other programs to
 * this programm.
 * */

#include "../include/Matrix.h"

/* mfw
 * This namespace is the port for other programs to the code in here. It holds
 * references to other classes and actions and is the only visible fragmet
 * (except the Matrix class itself) to the outside. */
namespace mfw {
	/* MatrixFramework is a class full of static methods to create
	 * matrices in certain forms. */
	class MatrixFramework {
	private:
		static Matrix **pp_matrixlist; /* pointers to all created matrices so we can 
									    * free all space when needed */
	public:
		/* Class related methods */
		static void close(); /* free all allocated space for matrices and
							  * set pointers to nullptr */
		static int matrixCount(); /* returns how many matrices have been created */
	public:
		/* Matrix related methods */
		static Matrix *matrixDup(const Matrix *p_mat); /* copies p_mat matrix and returns
													    * the pointer to the new matrix */
		static Matrix *createMatrix(int i_dim); /* create a i_dim x i_dim matrix
											    * with random values */
		static Matrix *createMatrix(int i_row, int i_col); /* create a i_row x i_col
														   * matrix with random values */
		static Matrix *zero(int i_dim); /* create a i_dim x i_dim matrix of zeros */
		static Matrix *zero(int i_row, int i_col); /* createa a i_row x i_col matrix
												   * of zeros */
		static Matrix *one(int i_dim); /* create a i_dim x i_dim matrix of ones */
		static Matrix *one(int i_row, int i_col); /* createa a i_row x i_col matrix 
												  * of ones */
		static Matrix *eye(int i_dim); /* create the identification matrix for 
									   * i_dim dimension */
		static Matrix *eye(int i_row, int i_col); /* create the identification matrix for
												   * i_row x i_col dimensional matrix */
	};
}